/* *****************************************************************************************************
 * Copyright 2009. Dbwebx Group
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 * *****************************************************************************************************
 */

package org.dbwebx.service.dao;

import java.util.List;

import org.dbwebx.domain.SourceNode;

/**
 * The interface for {@link SourceNode} entities management.
 * 
 * @author Izzet_Mustafayev
 * 
 */
public interface SourceNodeService {
	/**
	 * Lists available {@link SourceNode}s.
	 * 
	 * @return
	 */
	List<SourceNode> list();

	/**
	 * Persists {@link SourceNode} entity.
	 * 
	 * @param sourceNode
	 *            the {@link SourceNode} entity
	 */
	void persist(SourceNode sourceNode);

	/**
	 * Loads {@link SourceNode} by given sourceNodeId.
	 * 
	 * @param sourceNodeId
	 *            the identity to find {@link SourceNode} by
	 * @return {@link SourceNode} from the persistence storage
	 */
	SourceNode load(Long sourceNodeId);

	/**
	 * Searches {@link SourceNode} by given name.
	 * 
	 * @param sourceNodeName
	 *            the {@link SourceNode} name to find
	 * @return found {@link SourceNode}
	 */
	SourceNode find(String sourceNodeName);
}
